package com.cus.shd.sharingjdbc.switchDataSource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cus.shd.sharingjdbc.mappers.RecordOrderLogMapper;
import com.cus.shd.sharingjdbc.model.RecordOrderLog;
import com.cus.shd.sharingjdbc.service.RecordOrderLogService;
import com.cus.shd.sharingjdbc.switchDataSource.aop.DataSourceTag;
import com.cus.shd.sharingjdbc.utils.RandomUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author lcc
 * @since 2021-10-30
 */
@Service
public class RecordOrderLogShardingBizService extends ServiceImpl<RecordOrderLogMapper, RecordOrderLog>{

    @Autowired
    RecordOrderLogMapper recordOrderLogMapper;

    //通过动态切换数据源
    @DataSourceTag(DataSourceEnum.SHARDING)
    public RecordOrderLog queryByShardingOrderDeliveryId(Long id) {
        return recordOrderLogMapper.queryByOrderDeliveryId(id);
    }
}
